import request from '@/utils/request'

const api = {
    fwgl: '/fwgl/wj'
}

export function getFwglZhcxList(parameter) {
    return request({
        url: api.fwgl + '/queryZhcx',
        method: 'get',
        params: parameter
    })
}

export function getInfo(unid) {
    return request({
        url: api.fwgl + '/' + unid,
        method: 'get'
    })
}

export function getFwglList(parameter) {
    return request({
        url: api.fwgl + '/list',
        method: 'get',
        params: parameter
    })
}

export function getZhcxList(parameter) {
    return request({
        url: api.fwgl + '/zhcxlist',
        method: 'get',
        params: parameter
    })
}

export function getDayjList(parameter) {
    return request({
        url: api.fwgl + '/dayj/list',
        method: 'get',
        params: parameter
    })
}

export function getFwglListnd(parameter) {
    return request({
        url: api.fwgl + '/listWithNd',
        method: 'get',
        params: parameter
    })
}

export function getFwglYearList() {
    return request({
        url: api.fwgl + '/listWithYear',
        method: 'get'
    })
}

export function exportFwglList(parameter) {
    return request({
        url: api.fwgl + '/export',
        method: 'get',
        params: parameter
    })
}

export function saveFwgl(parameter) {
    return request({
        url: api.fwgl,
        method: 'post',
        data: parameter,
        headers: {
            'Content-Type': 'application/json;charset=UTF-8'
        }
    })
}

export function delFwgl(parameter) {
    return request({
        url: api.fwgl,
        method: 'Delete',
        params: parameter
    })
}

export function base64flowimage(businessKey) {
    return request({
        url: api.fwgl + '/base64flowimage/' + businessKey,
        method: 'get'
    })
}

export function getSendFlowNode(unid) {
    return request({
        url: api.fwgl + '/getSendFlowNode?unid=' + unid,
        method: 'get'
    })
}

export function getHistoryProcess(unid) {
    return request({
        url: api.fwgl + '/getHistoryProcess?businessKey=' + unid,
        method: 'get'
    })
}

export function fwglSendDoc(urlparameter, data) {
    return request({
        url: api.fwgl + '/sendDoc',
        method: 'post',
        params: urlparameter,
        data: data,
        headers: {
            'Content-Type': 'application/json;charset=UTF-8'
        }
    })
}

export function readedDoc(data) {
    return request({
        url: api.fwgl + '/readedDoc',
        method: 'post',
        data: data,
        headers: {
            'Content-Type': 'application/json;charset=UTF-8'
        }
    })
}

export function quickHand(data) {
    return request({
        url: api.fwgl + '/quickHand',
        method: 'post',
        data: data,
        headers: {
            'Content-Type': 'application/json;charset=UTF-8'
        }
    })
}

export function publishDoc(data) {
    return request({
        url: api.fwgl + '/publishDoc',
        method: 'post',
        data: data,
        headers: {
            'Content-Type': 'application/json;charset=UTF-8'
        }
    })
}

export function getCallbackNode(unid) {
    return request({
        url: api.fwgl + '/getCallbackNode/' + unid,
        method: 'get'
    })
}

export function callbackDoc(urlparameter, dataparams) {
    return request({
        url: api.fwgl + '/callbackDoc',
        method: 'post',
        data: dataparams,
        params: urlparameter,
        headers: {
            'Content-Type': 'application/json;charset=UTF-8'
        }
    })
}

export function writeNotion(dataparams) {
    return request({
        url: api.fwgl + '/writeNotion',
        method: 'post',
        data: dataparams,
        headers: {
            'Content-Type': 'application/json;charset=UTF-8'
        }
    })
}

export function finishDoc(dataparams) {
    return request({
        url: api.fwgl + '/finishDoc',
        method: 'post',
        data: dataparams,
        headers: {
            'Content-Type': 'application/json;charset=UTF-8'
        }
    })
}

export function finalizeDoc(dataparams) {
    return request({
        url: '/flow/func/finalizeDoc',
        method: 'get',
        data: dataparams,
        headers: {
            'Content-Type': 'application/json;charset=UTF-8'
        }
    })
}

export function unFinalizeDoc(dataparams) {
    return request({
        url: '/flow/func/unFinalizeDoc',
        method: 'get',
        data: dataparams,
        headers: {
            'Content-Type': 'application/json;charset=UTF-8'
        }
    })
}

export function getNewUnid() {
    return request({
        url: '/fwgl/common/getUnid',
        method: 'get'
    })
}

//  给发文号
export function getflsh(params) {
    return request({
        url: api.fwgl + '/flsh',
        method: 'get',
        params: params
    })
}

//  漏号
export function getlh(params) {
    return request({
        url: api.fwgl + '/lh',
        method: 'get',
        params: params
    })
}


export function searchOrgList(params) {
    return request({
        url: '/system/org/list',
        method: 'get',
        params
    })
}

// 获取待移交 发文 
export function getListDyjToPdf(params) {
    return request({
        url: '/fwgl/wj/listDyjToPdf',
        method: 'get',
        params
    })
}

export const fwglExport = api.fwgl + '/export'